package com.ktjiaoyu.t313.dao;

import com.ktjiaoyu.t313.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserDaoImpl implements UserDao {
    //由sqlsessionTemplate替换之前的sqlsession实例操作数据
    private SqlSessionTemplate sqlSessionTemplate;

    public SqlSessionTemplate getSqlSessionTemplate() {
        return sqlSessionTemplate;
    }

    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        this.sqlSessionTemplate = sqlSessionTemplate;
    }

    @Override
    public List<User> findUserList() {

        return sqlSessionTemplate.getMapper(UserDao.class).findUserList();
    }

    @Override
    public int deleteUserById(int id) {

        return 0;
    }
}
